<!-- 通知公告组件 -->

<template>
    <div class="border_css">

        <van-list
                v-model="loading"
                :finished="finished" 
                @load="onLoad" >
            <van-cell v-for="item in list" :key="item" :title="item" />
        </van-list>
    </div>
</template>
<script>
	// import goNews from "@/net/apis/goNews.js";
	const goNews = require("@/net/apis/goNews.js")
export default {
    name:"newsComp",
    data(){
        return {
            list: [],
            loading: false,
            finished: false,
        }
    },
    methods:{
        async onLoad(){
            console.log(1111)
            //加载新闻
            // 异步更新数据
            // setTimeout 仅做示例，真实场景中一般为 ajax 请求
			const resp = await goNews.queryNews("20");
			console.log("数据",resp);
			if(resp && resp.object.length>0){
				for(i=0;i<resp.object.length;i++){
					this.list.push(resp.object[i].newsTitle);
				}
				
			}else{
				this.list.push("暂无最新公告");
				
			}
			this.finished=true ;
            
        }
    }
}
</script>

<style>

</style>